<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020\9\15 0015
  Time: 14:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>admin-product-productattributelist</title>
    <%@include file="/views/common/headerStyle.jsp" %>
</head>
<body>
<div class="container">
    <%@include file="/views/common/header.jsp" %>
    <div class="row main_box">
        <div class="col-sm-3"><%@include file="/views/common/leftMenu.jsp" %></div>
        <div class="col-sm-9">


            <table class="table table-striped">
                <thead>
                <tr>
                    <th scope="col">#</th>
                    <th scope="col">属性名称</th>
                    <th scope="col">模型名称</th>
                    <th scope="col">输入方式</th>
                    <th scope="col">属性值</th>
                    <th scope="col">排序</th>
                    <th scope="col">操作</th>
                </tr>
                </thead>
                <tbody>

                <c:forEach items="${page.list}" var="item">

                    <tr>
                        <th scope="row">${item.id}</th>
                        <td>${item.attr_name}</td>
                        <td>${item.model_name}</td>
                        <td>${item.attr_input_type}</td>
                        <th scope="col">${item.attr_values}</th>
                        <th scope="col">${item.sort_orderx}</th>
                        <td>
                            <div class="btn-group" role="group" aria-label="Basic example">
                                <button type="button" class="btn btn-success btn-sm"><a href="${BASE_PATH}admin/product/editproductattribute?attr_id=${item.id}" target="_self">编辑</a></button>
                                <button type="button" class="btn btn-danger btn-sm">删除</button>
                            </div>
                        </td>
                    </tr>

                </c:forEach>

                </tbody>
            </table>

            <div class="col-sm-12">

                <nav aria-label="Page navigation example">
                    <ul class="pagination">
                        <c:if test="${page.hasPreviousPage}">
                            <li class="page-item">
                                <a class="page-link" href="#" aria-label="Previous">
                                    <span aria-hidden="true">&laquo;</span>
                                </a>
                            </li>
                        </c:if>

                        <c:forEach items="${page.navigatepageNums}" var="item">
                            <c:choose>
                                <c:when test="${page.pageNum==item}">    <!--如果 -->
                                    <li class="page-item active"><a class="page-link" href="?currentPage=${item}&${urlParams}">${item}</a></li>
                                </c:when>
                                <c:otherwise>  <!--否则 -->
                                    <li class="page-item"><a class="page-link" href="?currentPage=${item}&${urlParams}">${item}</a></li>
                                </c:otherwise>
                            </c:choose>

                        </c:forEach>

                        <c:if test="${page.hasNextPage}">
                            <li class="page-item">
                                <a class="page-link" href="#" aria-label="Next">
                                    <span aria-hidden="true">&raquo;</span>
                                </a>
                            </li>
                        </c:if>
                    </ul>
                </nav>

            </div>

        </div>
    </div>
    <%@include file="/views/common/footer.jsp" %>
</div>
</body>
<%@include file="/views/common/footerStyle.jsp" %>
</html>

